package com.bjt.wms.sys.service;

import com.bjt.utils.TreeUtil;
import com.bjt.wms.sys.model.Menu;

import java.util.List;

public class MenuService {

    public List<Menu> getMenu(String menuType) {
        List<Menu> menuList = Menu.dao.find("select * from menu where menuType='" + menuType + "'");

        //调用TreeTest工具类方法生成树形结构的List集合
        List<Menu> treeList = TreeUtil.listToTree(menuList);
        return treeList;
    }

    public List<Menu> getMenuList(String menuType)
    {
        return Menu.dao.find("select * from menu where menuType='" + menuType + "'");
    }
}
